package com.study.lxy.classloader;

import java.io.FileInputStream;
import java.io.InputStream;

public class HotTest {

    public static void main(String[] args) throws Exception {
        String path = "D:/workspace/idea/studymain/out/production/jvmstudy/com/study/lxy/classloader/FunctionTest.class";
        for (int i = 0; i < 20; i++) {
            HotReplaceClassLoader cl = new HotReplaceClassLoader();
            InputStream is = new FileInputStream(path);
            byte[] bytes = new byte[is.available()];
            is.read(bytes);
            is.close();
            Class aClass = cl.loadBytes(bytes);
            Object o = aClass.newInstance();
            System.out.println(o.toString());
            Thread.sleep(10000);

        }
    }

}
